#ifndef __THREAD_POOL__
#define __THREAD_POOL__

#include <func.h>
#include "taskQueue.h"
#include "command.h"
typedef struct threadPool_s {
    pthread_t *tidArr;
    int workerNum;
    taskQueue_t taskQueue;
    int exitflag;
    user_t* user;
    
} threadPool_t;

typedef struct train_s {
    int length;
    char data[1000];
} train_t;

typedef struct userInfo_s
{
    int netfd;
    char pwd[1024];
} userInfo_t;

typedef struct train_state_s{
    int state;
    int length;
    char buff[100];
}train_state_t;

typedef enum{
    CD,LS,PUTS,GETS,REMOVE,PWD,MKDIR,RMDIR
}OrderType;

int initThreadPool(threadPool_t *threadPool, int workerNum);
int makeWorker(threadPool_t *threadPool);
void *threadFunc(void *arg);
int epollAdd(int epfd, int fd);
int epollDel(int epfd, int fd);
int tcpInit(const char *ip, const char *port, int * psockfd);
int transfile(int netfd);

#endif
